const Generator = require('yeoman-generator');
module.exports = class extends Generator {
    static answers = {}
    //用户交互
    //ejs动态注入数据
    prompting() {
        return this.prompt([{
            type: 'input',
            name: 'title',
            message: '请输入title'
        }]).then(
            answers => {
                this.answers = answers;
            }
        )
    }
    write() {
        const tempPath = this.templatePath('demo.html');
        const outPath = this.destinationPath('demo.html');
        this.fs.copyTpl(tempPath, outPath,this.answers)
    }
}